package com.example.teacher.config;

import org.springframework.context.annotation.Configuration;

@Configuration
public class JsonMgsConfig {

//    @Bean("teacherConverter")
//    public MessageConverter jsonMessageConverter() {
//        ObjectMapper objectMapper = new ObjectMapper();
//        // 配置类型信息处理
//        objectMapper.activateDefaultTyping(
//                objectMapper.getPolymorphicTypeValidator(),
//                ObjectMapper.DefaultTyping.NON_FINAL,
//                JsonTypeInfo.As.PROPERTY
//        );
//        return new Jackson2JsonMessageConverter(objectMapper);
//    }

//    @Bean("teacherAmqpTemplate")
//    public AmqpTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
//        RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
//        rabbitTemplate.setMessageConverter(jsonMessageConverter());
//        return rabbitTemplate;
//    }
}
